home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Begin VB.Form Cards
- BorderStyle = 1 'Fixed Single
- Caption = "Vocabulary Flashcards"
- ClientHeight = 2730
- ClientLeft = 150
- ClientTop = 435
- ClientWidth = 6030
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Icon = "Flashcard.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2730
- ScaleWidth = 6030
- StartUpPosition = 2 'CenterScreen
- Begin MSComDlg.CommonDialog CDialog
- Left = 0
- Top = 0
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- Filter = "Vocab Files (*.jfv)|*.jfv|All Files|*.*|"
- InitDir = "d:\"
- End
- Begin VB.TextBox txtDefinition
- BackColor = &H8000000B&
- Height = 765
- Left = 1200
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 3
- TabStop = 0 'False
- Top = 975
- Width = 4815
- End
- Begin VB.TextBox txtWord
- BackColor = &H8000000B&
- Height = 765
- Left = 1200
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 1
- TabStop = 0 'False
- Top = 75
- Width = 4815
- End
- Begin VB.PictureBox pctFrame
- BackColor = &H8000000B&
- Height = 450
- Left = 0
- ScaleHeight = 390
- ScaleWidth = 5955
- TabIndex = 5
- Top = 2025
- Width = 6015
- Begin VB.CommandButton cmdNext
- Caption = ">"
- Height = 315
- Left = 4725
- TabIndex = 10
- TabStop = 0 'False
- Top = 40
- Width = 465
- End
- Begin VB.CommandButton cmdShow
- Caption = "Show Definition"
- Default = -1 'True
- Height = 315
- Left = 1725
- TabIndex = 9
- Top = 40
- Width = 2490
- End
- Begin VB.CommandButton cmdBack
- Caption = "<"
- Height = 315
- Left = 750
- TabIndex = 8
- TabStop = 0 'False
- Top = 40
- Width = 465
- End
- Begin VB.CommandButton cmdLast
- Caption = ">>"
- Height = 315
- Left = 5400
- TabIndex = 7
- TabStop = 0 'False
- Top = 40
- Width = 465
- End
- Begin VB.CommandButton cmdFirst
- Caption = "<<"
- Height = 315
- Left = 75
- TabIndex = 6
- TabStop = 0 'False
- Top = 40
- Width = 465
- End
- End
- Begin VB.Label lblCardPosition
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "0 of 0"
- Height = 240
- Left = 75
- TabIndex = 4
- Top = 1800
- Width = 5865
- End
- Begin VB.Label lblDefinition
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Definition:"
- Height = 195
- Left = 75
- TabIndex = 2
- Top = 975
- Width = 885
- End
- Begin VB.Label lblWord
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Word:"
- Height = 195
- Left = 75
- TabIndex = 0
- Top = 75
- Width = 525
- End
- Begin VB.Label lblStatus
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = -15
- TabIndex = 11
- Top = 2475
- Width = 6045
- WordWrap = -1 'True
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileEditor
- Caption = "&Flashcard Editor"
- Shortcut = {F5}
- End
- Begin VB.Menu mnuFileLoad
- Caption = "&Load"
- WindowList = -1 'True
- Begin VB.Menu mnuFileLoadFlash
- Caption = "&Load Flashcards..."
- Shortcut = {F7}
- End
- Begin VB.Menu mnuFileLoadPause1
- Caption = "-"
- Visible = 0 'False
- End
- Begin VB.Menu mnuFileLoadRecord
- Caption = ""
- Index = 0
- Visible = 0 'False
- End
- End
- Begin VB.Menu mnuFileClose
- Caption = "&Close Flashcards"
- Shortcut = ^X
- End
- Begin VB.Menu mnuFilePause1
- Caption = "-"
- End
- Begin VB.Menu mnuFileExit
- Caption = "&Exit"
- Shortcut = ^C
- End
- End
- Begin VB.Menu mnuDisplay
- Caption = "&Display Options"
- Begin VB.Menu mnuDisplayRevealed
- Caption = "&Revealed"
- Begin VB.Menu mnuDisplayOpt
- Caption = "&Word"
- Checked = -1 'True
- Index = 0
- Shortcut = {F1}
- End
- Begin VB.Menu mnuDisplayOpt
- Caption = "&Definition"
- Index = 1
- Shortcut = {F2}
- End
- Begin VB.Menu mnuDisplayOpt
- Caption = "&Both"
- Index = 2
- Shortcut = {F3}
- End
- End
- Begin VB.Menu mnuDisplaySort
- Caption = "&Sort"
- Begin VB.Menu mnuDisplaySortEnt
- Caption = "&By Word"
- Index = 0
- Shortcut = ^W
- End
- Begin VB.Menu mnuDisplaySortEnt
- Caption = "&By Definition"
- Index = 1
- Shortcut = ^D
- End
- End
- End
- Attribute VB_Name = "Cards"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Compare Text
- Option Explicit
- Dim GiveDefinition As Boolean
- Dim HiddenBeingShown As Boolean
- Sub AddMenuRecord(Record As String, Optional Opening As Boolean)
- Dim i As Integer, j As Integer
- If Opening Then
- PrepareFileEntry Record
- If MenuRecords >= 1 Then
- mnuFileLoadRecord(1).Caption = Record
- SaveFileMenuChanges
- Else
- Opening = False
- End If
- End If
- If Not Opening Then
- If MenuRecords = MAXRECORDNUM Then Exit Sub
- MenuRecords = MenuRecords + 1
- Load mnuFileLoadRecord(MenuRecords)
- mnuFileLoadRecord(MenuRecords).Visible = True
- mnuFileLoadRecord(MenuRecords).Caption = Record
- End If
- mnuFileLoadPause1.Visible = True
- End Sub
- Public Sub ChangeMode(Enabled As Boolean)
- cmdShow.Enabled = Enabled
- cmdNext.Enabled = Enabled
- cmdLast.Enabled = Enabled
- cmdBack.Enabled = Enabled
- cmdFirst.Enabled = Enabled
- txtWord.Enabled = Enabled
- txtDefinition.Enabled = Enabled
- mnuFileClose.Enabled = Enabled
- mnuDisplaySort.Enabled = Enabled
- End Sub
- Sub ClearData()
- txtWord = ""
- txtDefinition = ""
- lblCardPosition = ""
- End Sub
- Private Sub cmdBack_Click()
- SetCardPosition CardsPosition - 1
- End Sub
- Private Sub cmdFirst_Click()
- SetCardPosition 1
- End Sub
- Private Sub cmdLast_Click()
- SetCardPosition FlashContents.Count
- End Sub
- Private Sub cmdNext_Click()
- SetCardPosition CardsPosition + 1
- End Sub
- Private Sub cmdShow_Click()
- DisplayData 2
- End Sub
- Sub DisableUnusuableObjects()
- Dim BackwardEnabled As Boolean
- Dim ForwardEnabled As Boolean
- Dim Label As String
- ChangeMode AreEntries
- BackwardEnabled = Not (CardsPosition <= 1) And AreEntries
- ForwardEnabled = Not (CardsPosition = FlashContents.Count) And AreEntries
- cmdBack.Enabled = BackwardEnabled
- cmdFirst.Enabled = BackwardEnabled
- cmdNext.Enabled = ForwardEnabled
- cmdLast.Enabled = ForwardEnabled
- cmdShow.Enabled = Not HiddenBeingShown And AreEntries
- lblCardPosition.Enabled = IsOpenFile Or AreEntries
- Label = MSGSHOW
- If GiveDefinition Then Label = Label & MSGWRD
- If Not GiveDefinition Then Label = Label & MSGDEF
- cmdShow.Caption = Label
- End Sub
- Sub DisplayCurrentCard()
- ClearData
- If GiveDefinition = False Then DisplayData 0
- If GiveDefinition Then DisplayData 1
- If HiddenBeingShown Then DisplayData 2
- If Not AreEntries Then CardsPosition = 0
- lblCardPosition = CardsPosition & " of " & FlashContents.Count
- End Sub
- Sub DisplayData(Data As Integer)
- If Data = 0 Or Data > 1 Then txtWord = GetRevealed(CardsPosition)
- If Data >= 1 Then txtDefinition = GetHidden(CardsPosition)
- End Sub
- Sub DeleteFileRecords()
- Dim i As Integer
- On Error Resume Next
- mnuFileLoadPause1.Visible = False
- For i = 1 To MenuRecords
- Unload mnuFileLoadRecord(i)
- Next i
- MenuRecords = 0
- End Sub
- Private Sub Form_Load()
- GetFileRecord
- If Command <> "" Then
- LoadFile (Command)
- End If
- CDialog.InitDir = App.Path
- ChangeMode (Command <> "")
- DisableUnusuableObjects
- End Sub
- Public Function LoadFile(FileToOpen As String) As Boolean
- LoadFile = GetFileContents(FileToOpen)
- SetCardPosition 1
- DisplayCurrentCard
- DisableUnusuableObjects
- End Function
- Private Sub mnuDisplayOpt_Click(Index As Integer)
- Dim i As Integer
- For i = 0 To 2
- mnuDisplayOpt(i).Checked = False
- Next i
- mnuDisplayOpt(Index).Checked = True
- HiddenBeingShown = (Index = 2)
- GiveDefinition = (Index = 1)
- DisableUnusuableObjects
- DisplayCurrentCard
- End Sub
- Private Sub mnuDisplaySortEnt_Click(Index As Integer)
- MousePointer = vbHourglass
- ChangeMode 0
- If Index = 0 Then SortEntries 0
- If Index = 1 Then SortEntries 1
- ChangeMode 1
- MousePointer = 0
- SetCardPosition CardsPosition
- If Editor.Visible Then Editor.PrintOutEntries
- End Sub
- Private Sub mnuFileEditor_Click()
- Editor.Show vbModal
- If OpenFile <> "" Or FlashContents.Count > 0 Then Cards.ChangeMode True
- SetCardPosition 1
- End Sub
- Private Sub mnuFileExit_Click()
- End
- End Sub
- Private Sub mnuFileClose_Click()
- CloseFile
- ClearData
- End Sub
- Private Sub mnuFileLoadFlash_Click()
- CDialog.ShowOpen
- If CDialog.FileName = "" Then Exit Sub
- LoadFile (CDialog.FileName)
- End Sub
- Private Sub mnuFileLoadRecord_Click(Index As Integer)
- Dim i As Integer
- LoadedByRecord = True
- SelRecord = Index
- i = LoadFile(mnuFileLoadRecord(Index).Caption)
- LoadedByRecord = False
- End Sub
- Sub PrepareFileEntry(MenuText As String)
- Dim i As Integer, j As Integer, FoundMatchingEntry As Boolean
- For i = MenuRecords To 1 Step -1
- If mnuFileLoadRecord(i).Caption = MenuText Then
- For j = i To 1 Step -1
- mnuFileLoadRecord(j).Caption = mnuFileLoadRecord(j - 1).Caption
- FoundMatchingEntry = True
- Next j
- End If
- Next i
- If Not FoundMatchingEntry Then
- If MenuRecords < MAXRECORDNUM Then
- MenuRecords = MenuRecords + 1
- Load mnuFileLoadRecord(MenuRecords)
- mnuFileLoadRecord(MenuRecords).Visible = True
- End If
- For i = MenuRecords To 1 Step -1
- mnuFileLoadRecord(i).Caption = mnuFileLoadRecord(i - 1).Caption
- Next i
- End If
- End Sub
- Sub SaveFileMenuChanges()
- Dim i As Integer
- DeleteEntries RecentFileList
- For i = 1 To MenuRecords
- RecentFileList.Add mnuFileLoadRecord(i).Caption
- Next i
- SaveFileRecords
- End Sub
- Sub SetCardPosition(PositionNumber As Integer)
- If PositionNumber < 1 Then PositionNumber = 1
- If FlashContents.Count = 0 Then PositionNumber = 0
- If PositionNumber > FlashContents.Count Then Exit Sub
- CardsPosition = PositionNumber
- DisableUnusuableObjects
- DisplayCurrentCard
- If cmdShow.Visible And cmdShow.Enabled Then cmdShow.SetFocus
- End Sub
- Public Sub ResetFileRecords()
- Dim i As Integer
- DeleteFileRecords
- For i = 1 To RecentFileList.Count
- AddMenuRecord RecentFileList(i)
- Next i
- End Sub
- Private Sub txtWord_GotFocus()
- SelectAll txtWord
- End Sub
- Private Sub txtDefinition_GotFocus()
- SelectAll txtDefinition
- End Sub
- Public Sub ShowStatus(Text As String)
- lblStatus = Text
- End Sub
- Public Function GetStatus() As String
- GetStatus = lblStatus
- End Function
-